package com.kfm.jdbc.day0406;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

public class GroupSender {

    public static void main(String[] args) {
        String msg = "hello group";
        try {
            InetAddress inetAddress = InetAddress.getByName("224.0.1.0");
            DatagramPacket dp = new DatagramPacket(msg.getBytes(), msg.length(), inetAddress, 8888);
            DatagramSocket socket = new DatagramSocket();
            socket.send(dp);
        } catch (SocketException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
